/*
 * GameObject.hpp
 *
 *  Created on: 28.09.2013
 *      Author: dima
 */

#ifndef MODEL_GAMEOBJECT_HPP_
#define MODEL_GAMEOBJECT_HPP_

#include "Types.hpp"
#include "CollisionModel.hpp"

#include <vector>
#include <SDL/SDL.h>



namespace Tanks
{

namespace Model
{
  //Forward declaration
  class GameObjectModel;

  class GameObjectModel
  {
  public:

    GameObjectModel();
    virtual ~GameObjectModel();

    // argActive indicates, whether you collided into something or something collided into you
    virtual void Collision(GameObjectModel * argGameObject,
                 CollisionModel::CollisionSide argCollisionSide,
                 bool argActive) = 0;

    SDL_Rect * GetRect(){ return m_rect; }

    int GetHeight() const { return m_rect->h; }
    int GetWidth() const { return m_rect->w; }

    GameObjectType GetType() const { return m_type; }

    int GetTeam() const { return m_team; }

  protected:

    long m_ticks;

    SDL_Rect * m_rect;

    GameObjectType m_type;

    int m_team;

  };


  // class for game objects, which you collide with
  class SolidBlockModel : public GameObjectModel
  {
  public:
    SolidBlockModel(int argX,
            int argY,
            int argW,
            int argH);

    virtual void Collision(GameObjectModel * argGameObject,
                 CollisionModel::CollisionSide argCollisionSide,
                 bool argActive){}

  private:
  };


  // class for game object, which you do not collide with
  class LandModel : public GameObjectModel
  {
  public:
    LandModel(int argX,
          int argY,
          int argW,
          int argH);

    virtual void Collision(GameObjectModel * argGameObject,
                 CollisionModel::CollisionSide argCollisionSide,
                 bool argActive){}

  private:
  };

}

}

#endif /* MODEL_GAMEOBJECT_HPP_ */
